package com.itmuch.cloud.comtroller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import com.itmuch.cloud.UsedrFeignClient;
import com.itmuch.cloud.user.User;

@RestController
public class MovieController {
	
	@Autowired
	private UsedrFeignClient usedrFeignClient;
	
	@GetMapping("/movie/{id}")
	public User findById(@PathVariable("id") Long id) {
		User user = usedrFeignClient.findById(id);
		return user;
	}
	
	@GetMapping("/test")
	public User findPost() {
		User user = new User();
		user.setAge((short)12);
		user.setId(1l);
		user.setName("小明");
		User users = usedrFeignClient.findPost(user);
		return users;
	}
	
	
	@GetMapping("/testget")
	public User findGet(User user) {
		User users = usedrFeignClient.findPost(user);
		return users;
	}
}
